package yz.cp.back.common.enums;

public enum EAccountType {
    NULL(0,"N/A"),
    N1(1,"资金"),
    N2(2,"保证金");
    private Integer code;
    private String name;

    EAccountType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static EAccountType getByCode(Integer code){
        for (EAccountType item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return EAccountType.NULL;
    }
}
